﻿@namespace CodeManDesktopBlazor.BlazorComponents.Pages.codeTemple
@typeparam K
@typeparam T
@{
    int count = 0;
}

<div class="div-code">
    <p class="p-n">
        using System;
        using System.ComponentModel;
        using BootstrapBlazor.Components;
    </p>
    <br />
    @if (!Model.classGenDTO.Namespace.IsNullOrEmpty())
    {
        <p class="p-n">namespace @Model.classGenDTO.Namespace</p>
        <p class="p-n">{</p>
    }
    @if (!Model.classGenDTO.Desc.IsNullOrEmpty())
    {
        <p class="p-c">@("\n")/// @("<summary>")</p>
        <p class="p-c">/// @Model.classGenDTO.Desc</p>
        <p class="p-c">/// @("<summary>\n")</p>
    }
    <p class="p-c"> public class @(Model.classGenDTO.Name.ToTitleCase())DTO</p>
    <p class="p-c">{</p>
    @foreach (var item in Model.classAttributeDTOLst)
    {
        @if (!item.ADesc.IsNullOrEmpty())
        {
            <p class="p-a">@("\n")/// @("<summary>")</p>
            <p class="p-a">/// @item.ADesc</p>
            <p class="p-a">/// @("<summary>\n")</p>
        }
        @if (item.IsAutoGenerate)
        {
            count++;
            <p class="p-a">[AutoGenerateColumn(Order =@count, Sortable = true)]</p>@("\n")
        }
        <p class="p-a">public @item.AType.GetDescription() @AttrTemplate(item) { get; set; }</p>
    }

    <br />
    <p class="p-c">}</p>
    <br />
    @if (!Model.classGenDTO.Namespace.IsNullOrEmpty())
    {
        <p class="p-n">}</p>
    }
</div>

